<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <!--取出model中的数据-->
    <span th:text="${name}"></span><br/>
    <hr/>
    <span th:text="${user.id}"></span><br/>
    <span th:text="${user.name}"></span><br/>
    <span th:text="${user.sex}"></span><br/>
    <span th:text="${user.age}"></span><br/>
    <hr/>
    <!--取出request和session中的数据-->
    request:<span th:text="${#request.getAttribute('username')}"></span><br/>
    session:<span th:text="${#session.getAttribute('username')}"></span><br/>
    <hr/>
    <!--使用工具类格式化时间-->
    <span th:text="${#dates.format(date,'yyyy-MM-dd HH:mm:ss')}"></span>
    <hr/>
    <!--字符串拼接-->
    <span th:text="'欢迎'+${name}"></span><br/>
    <span th:text="|欢迎${name}|"></span><br/>
</body>
</html>